<template>
  <div class="activities">
    <h2>公开活动列表</h2>
    <ul>
      <li v-for="activity in activities" :key="activity.id">
        <router-link :to="'/public-activities/' + activity.id">
          {{ activity.title }} - {{ activity.date }}
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: {
    activities: {
      type: Array,
      required: true
    }
  }
}
</script>

<style scoped>
.activities {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}
ul {
  list-style: none;
  padding: 0;
}
li {
  margin-bottom: 10px;
}
a {
  color: #42b983;
  text-decoration: none;
}
</style>